home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 05.zip / BS1 part 5 / IM_3.adf / Exec / piarc.LZH / imfc24r.rexx < prev    next >
OS/2 REXX Batch file  |  1992-05-05  |  4KB  |  146 lines

  1. /*
  2.  * imfc24r.rexx
  3.  *
  4.  *  Written by: Barry Chalmers and Ben Williams
  5.  * Last Update: April 20th, 1992
  6.  *         For: Black Belt Systems image processing series IM, IM F/c, and IP.
  7.  * ---------------------------------------------------------------------------
  8.  *    Revision: 1.02 - see ReadMe file for details on changes to this level
  9.  *              1.03 - passed in parameters for selective redraw
  10.  *                     and two monitor operation
  11.  */
  12.  
  13. /*
  14.  * Default display modes   - These are used when this is called with
  15.  *                           selective redraw parameters
  16.  */
  17.  def_overscan = 0;  /* 0 = non-overscan,  1 = overscan                     */
  18.  def_fcres    = 3;  /* 0 = 384x482, 1 = 512x482, 2 = 768x482, 3 = 1024x482 */
  19.  def_twomonitor = 1; /* 0 = one screen, 1 = using a second screen          */
  20.  
  21. parse arg jackin dx1 dy1 dx2 dy2
  22.  
  23. if jackin = 'finish' then do
  24.   exit 0;
  25.   end;
  26.  
  27. /*
  28.  * open rexxsupport.library -- needed for some functions
  29.  */
  30. if ~show('L',"rexxsupport.library") then do
  31.   if addlib('rexxsupport.library',0,-30,0) then do
  32.       /* everything's ok */
  33.     end;
  34.   else do
  35.     say 'We Have A Library Problem, Unable To Load "rexxsupport.library"';
  36.     say 'Cannot operate script without this library - sorry!';
  37.     exit 10;
  38.     end;
  39.   end;
  40.  
  41. /*
  42.  * This will automatically direct the script to the proper
  43.  * software, if it is running.
  44.  */
  45. prtnme = 'IP_Port'; /* assume Image Professional */
  46. if show('P','IP_Port') = 0 then do
  47.   if show('P','IM_Port') = 0 then do
  48.     say "Can't find image processor's ARexx port!!!"; /* not running? */
  49.     say "This script requires IP, IM or IM F/c to run!";
  50.     exit(20);
  51.     end;
  52.   else do
  53.     prtnme = 'IM_Port'; /* That's the thing about assumptions... */
  54.     end;                 /* We make em, user's break em.          */
  55.   end;
  56.  
  57.   /*
  58.    * This code attempts to read a file called "picmdpath" from REXX:
  59.    * If it can't find it, the script will assume that the commands
  60.    * associated with this PI Module are in "c:". If the file exists,
  61.    * the script will look in the path that is specified in the file.
  62.    * If you create this file, you MUST put a complete, correct path
  63.    * in it; if the commands are in a sub-directory, you have to put
  64.    * the trailing slash on the path (like, device:dir/).
  65.    * 
  66.    */
  67.   cmdpath = 'c:';
  68.   if open(fhandle,'rexx:picmdpath','read') then  /* open the file */
  69.     do
  70.       cmdpath = readln(fhandle);
  71.       call close(fhandle);  /* close the file    */
  72.     end
  73.  
  74. address(prtnme);
  75.  
  76. if jackin > 0 then do
  77.   overscan     = def_overscan;
  78.   fcres        = def_fcres;
  79.   twomonitor   = def_twomonitor;
  80. end;
  81. else do
  82.   options results;
  83.   'askyn "Overlay Mode","Using a Second Monitor"';
  84.   twomonitor = result;
  85.   options;
  86.   
  87.   options results;
  88.   'askyn "Display Non- Overscan","Display Overscan"';
  89.   overscan = result;
  90.   options;
  91.   
  92.   options results;
  93.   'gadgets "Lo-Res","384x482","Med-Res","512x482","Med-Res","768x482","Hi-Res","1024x482"';
  94.   fcres = result;
  95.   options;
  96.   if fcres = 0 then do
  97.     address;
  98.     exit 0;
  99.     end
  100.   fcres = fcres - 1;
  101.   
  102.   'wbtofront';
  103.   
  104.   options results;
  105.   'jackin';
  106.   jackin = result;
  107.   options;
  108. end;
  109.  
  110. /* Although XSTART and YSTART are optional                          */
  111. /* (IMFC24 centers them when defaulting), you will probably want    */
  112. /* to set XSTART at least, for your Amiga and preferences.          */
  113. /* A good guess for YSTART is 40.                                   */
  114.  
  115. if fcres = 0 then do
  116.   xstart = 40;
  117.   ystart = 40;
  118.   end
  119. if fcres = 1 then do
  120.   xstart = 56;
  121.   ystart = 40;
  122.   end
  123. if fcres = 2 then do
  124.   xstart = 78;
  125.   ystart = 40;
  126.   end
  127. if fcres = 3 then do
  128.   xstart = 104;
  129.   ystart = 40;
  130.   end
  131.  
  132. /* USAGE for the IMFC24 program is                             */
  133. /*      IMFC24 <jackin> [fcres] [overscan] [xstart] [ystart] [twomonitor] [dx1] [dy1] [dx2] [dy2] */
  134. /* Default is                                                  */
  135. /*      IMFC24    -        0        0      (center) (center)   */  
  136.  
  137. address command cmdpath||'imfc24 '||jackin||' '||fcres||' '||overscan||' '||xstart||' '||ystart||' '||twomonitor||' '||dx1||' '||dy1||' '||dx2||' '||dy2;
  138. address(prtnme);
  139.  
  140. 'tofront';
  141. 'FCREDRAW';
  142. 'finish';
  143. address;
  144.  
  145. exit 0;
  146.